const API = require('../../pages/api/index')
const {
  typeJson
} = require('../../utils/typejson')
let prolist = wx.getStorageSync('prolist') == '' ? wx.getStorageSync('prolist') : JSON.parse(wx.getStorageSync('prolist'))







Page({

  /**
   * 页面的初始数据
   */
  data: {
    pulldown: "",
    pullup: 2,
    addButton: true,
    Refresh: false,
    prolist: wx.getStorageSync('prolist') == '' ? wx.getStorageSync('prolist') : JSON.parse(wx.getStorageSync('prolist')),

    listConfig: [{
        label: '班前会时间',
        prop: 'beforeTime'
      },

      {
        label: '班组长',
        prop: 'classMonitors',

      }
    ],

    slide: {
      slideButton: {
        text: '编辑',
        extClass: 'test',
        src: '/page/weui/cell/icon_star.svg', // icon的路径
      },
      formConfig: [{
          label: '地点',
          prop: 'place',
        },



        {
          label: '班组',
          prop: 'orgName',
          hidden: 'edit',
        },
        {
          label: '班组',
          prop: 'attendDepart',
          type: 'multiDropDown',
          required: true,
          hidden: 'look',
          net: {
            url: '/app/siteMeeting/getDepartList',
            method: 'post',
            data: {
              mineId: true,

            },
            key: 'id',
            value: 'orgName'
          }
        },



        {
          label: '班组长',
          prop: 'classMonitors',
          hidden: 'look',
        },
        {
          label: '班组长',
          prop: 'classMonitor',
          type: 'multiDropDown',
          required: true,
          hidden: 'look',
          net: {
            url: '/app/memberinfo/getList',
            method: 'post',
            data: {
              mineId: true,
            },
            key: 'memberId',
            value: 'nickName'
          }
        },

        {
          label: '跟班领导',
          prop: 'classLeaderUser',
          hidden: 'edit',
        },
        {
          label: '跟班领导',
          prop: 'classLeader',
          type: 'multiDropDown',
          required: true,
          hidden: 'look',
          net: {
            url: '/app/memberinfo/getList',
            method: 'post',
            data: {
              mineId: true,

            },
            key: 'memberId',
            value: 'nickName'
          }
        },
        {
          label: '劳动保护装备穿戴是否整洁规范',
          prop: 'isClean',
          jsonType: typeJson.bool,
          type: 'dropDown',
          required: true,
        },
        {
          label: '安全帽佩戴是否符合要求，下颚带松紧适度',
          prop: 'isSafe',
          jsonType: typeJson.bool,
          type: 'dropDown',
          required: true,
        },
        {
          label: '工作班成员是否睡眠充足，精力充沛',
          prop: 'isSleep',
          jsonType: typeJson.bool,
          type: 'dropDown',
          required: true,

        },
        {
          label: '工作班成员情绪是否正常',
          prop: 'isEmotion',
          jsonType: typeJson.bool,
          type: 'dropDown',
          required: true,
        },
        {
          label: '工作班成员健康状态是否良好',
          prop: 'isHealth',
          jsonType: typeJson.bool,
          type: 'dropDown',
          required: true,
        },
        {
          label: '出勤人数',
          prop: 'work',
          type: "number",
          required: true,
        },
        {
          label: '请假人数',
          prop: 'leaveint',
          type: "number",
          required: true,
        },
        {
          label: '其他事由人数',
          prop: 'other',
          type: "number",
          required: true,
        },
        {
          label: '上级文件名称',
          prop: 'documentName',
          type: 'image',
        },
        {
          label: '规章制度',
          prop: 'role',
          type: 'image',
        },
        {
          label: '学习内容中的健康状态',
          prop: 'studyHealth',
          jsonType: typeJson.bool,
          type: 'dropDown',
          required: true,
        },
        {
          label: '本班进行哪种作业',
          prop: 'homework',
          jsonType: typeJson.homework,
          type: 'dropDown',

        },
        {
          label: '工作安排及安全注意事项',
          prop: 'basicNeed',
          hidden: 'edit',
        },
        {
          label: '工作安排及安全注意事项',
          prop: 'basicNeed',
          type: 'multiDropDown',
          required: true,
          hidden: 'look',
          net: {
            url: '/app/lineMeeting/getBasicNeed',
            method: 'post',
            data: {
              mineId: true,

            },
            key: 'id',
            value: 'function'
          }
        },

        {
          label: '工作是否完成',
          prop: 'workComplete',
          jsonType: typeJson.bool,
          type: 'dropDown',
          required: true,
        },
        {
          label: '生产现场、设备是否清理干净',
          prop: 'afterClean',
          jsonType: typeJson.bool,
          type: 'dropDown',
          required: true,
        },
        {
          label: '是否出现违纪违章现象',
          prop: 'reverseRole',
          jsonType: typeJson.bool,
          type: 'dropDown',
          required: true,
        },
        {
          label: '工作小结',
          prop: 'workRemark',
        },
        {
          label: '班组长签名',
          prop: 'classleaderSignature',
        },
      ],
    },


    formConfig: [



      {
        label: '地点',
        prop: 'place',
      },



      {
        label: '班组',
        prop: 'orgName',
        hidden: 'edit',
      },
      {
        label: '班组',
        prop: 'attendDepart',
        type: 'multiDropDown',
        required: true,
        hidden: 'look',
        net: {
          url: '/app/siteMeeting/getDepartList',
          method: 'post',
          data: {
            mineId: true,

          },
          key: 'id',
          value: 'orgName'
        }
      },



      {
        label: '班组长',
        prop: 'classMonitors',
        hidden: 'edit',
      },
      {
        label: '班组长',
        prop: 'classMonitor',
        type: 'multiDropDown',
        required: true,
        hidden: 'look',
        net: {
          url: '/app/memberinfo/getList',
          method: 'post',
          data: {
            mineId: true,

          },
          key: 'memberId',
          value: 'nickName'
        }
      },


      {
        label: '跟班领导',
        prop: 'classLeaders',
        hidden: 'edit',
      },
      {
        label: '跟班领导',
        prop: 'classLeader',
        type: 'multiDropDown',
        required: true,
        hidden: 'look',
        net: {
          url: '/app/memberinfo/getList',
          method: 'post',
          data: {
            mineId: true,

          },
          key: 'memberId',
          value: 'nickName'
        }
      },
      {
        label: '劳动保护装备穿戴是否整洁规范',
        prop: 'isClean',
        type: 'box',
        checked:0,
           
      },
      {
        label: '安全帽佩戴是否符合要求，下颚带松紧适度',
        prop: 'isSafe',
        type: 'box',
        checked:0,
       
      },
      {
        label: '工作班成员是否睡眠充足，精力充沛',
        prop: 'isSleep',
        type: 'box',
        checked:0,
       

      },
      {
        label: '工作班成员情绪是否正常',
        prop: 'isEmotion',
        type: 'box',
        checked:0,
       
      },
      {
        label: '工作班成员健康状态是否良好',
        prop: 'isHealth',
        type: 'box',
        checked:0,
       
      },
      {
        label: '出勤人数',
        prop: 'work',
        type: "number",

        required: true,
      },
      {
        label: '请假人数',
        prop: 'leaveint',
        type: "number",
        required: true,
      },
      {
        label: '其他事由人数',
        prop: 'other',
        type: "number",

      },
      {
        label: '上级文件名称',
        prop: 'documentName',
        type: 'image',
      },
      {
        label: '规范章程',
        prop: 'role',
        type: 'image',
      },
      {
        label: '学习内容中的健康状态',
        prop: 'studyHealth',
        type: 'box',
        checked:0,
        
      },
      {
        label: '本班进行哪种作业',
        prop: 'homework',
        jsonType: typeJson.homework,
        type: 'dropDown',
      },
      {
        label: '工作安排及安全注意事项',
        prop: 'basicNeed',
        hidden: 'edit',
      },
      {
        label: '工作安排及安全注意事项',
        prop: 'basicNeed',
        type: 'multiDropDown',
      
        hidden: 'look',
        net: {
          url: '/app/lineMeeting/getBasicNeed',
          method: 'post',
          data: {
            mineId: true,

          },
          key: 'id',
          value: 'function'
        }
      },

      {
        label: '工作是否完成',
        prop: 'workComplete',
        type: 'box',
        checked:0,
        
      },
      {
        label: '生产现场、设备是否清理干净',
        prop: 'afterClean',
        type: 'box',
        checked:0,
        
      },
      {
        label: '是否出现违纪违章现象',
        prop: 'reverseRole',
        type: 'box',
        checked:0,     
      },
      {
        label: '工作小结',
        prop: 'workRemark',
      },
      {
        label: '班组长签名',
        prop: 'classleaderSignature',
      },

    ],


    net: {

      select: {
        url: `/app/lineMeeting/getList`,
        method: 'post',
        data: {
          mineId: true,

        }
      },
      delete: {
        url: '/app/lineMeeting/delete',
        method: 'post',
        data: {

        }
      },
      insert: {
        url: '/app/lineMeeting/edit',
        method: 'post',
        data: {
          mineId: true,


        }
      },
      update: {
        url: '/app/lineMeeting/edit',
        method: 'post',
        data: {

        }
      }
    },
    showCom: true
  },




  /**
   * 生命周期函数--监听页面加载
   */


  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {


    this.setData({
      showCom: false
    })

    this.setData({
      showCom: true
    })
  },



  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    wx.showLoading({
      title: '刷新中...',
    })
    this.setData({
      Refresh: true
    })
    wx.hideLoading();
    wx.stopPullDownRefresh()
    this.setData({
      Refresh: false
    })
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    this.setData({
      pullup: this.data.pullup + 1
    })
  },


  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})